<template>
  <div class="wrapper">
    <m-home v-if="isMobile"></m-home>
    <PHome v-else></PHome>
  </div>
</template>

<script>
import MHome from '../mobile';
import PHome from '../../../www/views/welcome';

export default {
  components: {
    MHome,
    PHome
  },
  data() {
    return {
      isMobile: false
    };
  },
  mounted() {
    this.deteckEnv();
  },
  methods: {
    deteckEnv() {
      const fn = () => {
        const isMobile = /Android|webOS|iPhone|iPod|BlackBerry/i.test(
          navigator.userAgent
        );
        this.isMobile = isMobile;
      };
      fn();
      setInterval(fn, 800);
    }
  }
};
</script>
